<?php

// dingo api 的实例
$api = app('Dingo\Api\Routing\Router');

$params = ['middleware' => [
    'api.throttle',//来设置访问节流
    'serializer:array',//去掉transformer的包裹层
    'bindings',//支持 路由模型注入
],
    'limit' => 60,//设置访问的次数
    'expires' => 1,//设置时间的限定
];

$api->version('v1', $params, function ($api) {

    //后台管理员登录的路由
    $api->group(['prefix' => 'admin'], function ($api) {
        //后台管理员登录
        $api->post('login', [\App\Http\Controllers\Admin\LoginController::class, 'login']);
        //获取登录用户的信息
        $api->get('my', [\App\Http\Controllers\Admin\LoginController::class, 'me']);
        //刷新用户登录的token值
        $api->post('refresh/token', [\App\Http\Controllers\Admin\LoginController::class, 'refresh']);
        //退出登录
        $api->post('logout', [\App\Http\Controllers\Admin\LoginController::class, 'logout']);

    });

    //需要登录的路由组   ['middleware' => 'api.auth']为 jwt 的 api 认证中间件

    $api->group(['middleware' => 'api.auth', 'prefix' => 'admin'], function ($api) {
        /**
         * 商品相关路由
         */
        //商品资源
        $api->resource('product', \App\Http\Controllers\Admin\Product\ProductController::class, ['except' => ['update']]);
        //获取头部标签以及数量
        $api->post('product/get_header', [\App\Http\Controllers\Admin\Product\ProductController::class, 'get_header'])->name('product.get_header');
        //后台商品修改
        $api->patch('product/{product}', [\App\Http\Controllers\Admin\Product\ProductController::class, 'update'])->name('product.update');
        //商品状态修改
        $api->put('product/status', [\App\Http\Controllers\Admin\Product\ProductController::class, 'status'])->name('product.status');
        //从回收站恢复商品
        $api->put('product/{product}/restore', [\App\Http\Controllers\Admin\Product\ProductController::class, 'restore'])->name('product.restore');
        //商品分类资源路由
        $api->resource('product_category', \App\Http\Controllers\Admin\Category\ProductCategoryController::class, ['except' => ['update']]);
        //商品分类修改
        $api->patch('product_category/{product_category}', [\App\Http\Controllers\Admin\Category\ProductCategoryController::class, 'update'])->name('product_category.update');
        //商品分类状态修改
        $api->put('product_category/status', [\App\Http\Controllers\Admin\Category\ProductCategoryController::class, 'status'])->name('product_category.status');
        //商品规格模板
        $api->resource('product_rule', \App\Http\Controllers\Admin\Product\ProductRuleController::class, ['except' => ['destroy']]);
        //商品规格删除
        $api->delete('product_rule', [\App\Http\Controllers\Admin\Product\ProductRuleController::class, 'destroy'])->name('product_rule.destroy');
        //商品评论
        $api->resource('product_reply', \App\Http\Controllers\Admin\Product\ProductReplyController::class, ['except' => ['show']]);
        /**
         * 系统配置路由
         */
        // 系统配置菜单路由
        $api->resource('config_category', \App\Http\Controllers\Admin\Category\ConfigCategoryController::class);
        // 系统配置菜单状态禁用与启用
        $api->put('config_category/{category}/status', [\App\Http\Controllers\Admin\Category\ConfigCategoryController::class, 'status'])->name('config_category.status');
        // 系统配置路由
        $api->resource('config/{config}/index', \App\Http\Controllers\Admin\System\SystemConfigController::class);
        // 配置的禁用和使用
        $api->put('config/{config}/status', [\App\Http\Controllers\Admin\System\SystemConfigController::class, 'status'])->name('config.index.status');
        // 获取配置分类名路由
        $api->get('config_name', [\App\Http\Controllers\Admin\Category\ConfigCategoryController::class, 'config_name'])->name('config_name');
        /**
         * 组合数据路由
         */
        // 组合数据组路由
        $api->resource('system/group', \App\Http\Controllers\Admin\System\SystemGroupController::class);
        // 组合数据路由
        $api->resource('system/group/{group}/data', \App\Http\Controllers\Admin\System\SystemGroupDataController::class);
        // 组合数据禁用和启用
        $api->put('system/data/{data}/status', [\App\Http\Controllers\Admin\System\SystemGroupDataController::class, 'status'])->name('system.group.data.status');

        /**
         * 附件分类路由
         */
        // 附件分类列表
        $api->resource('attachment_category', \App\Http\Controllers\Admin\Category\SystemAttachmentCategoryController::class);
        /**
         * 附件路由
         */
        // 附件列表
        $api->get('attachment', [\App\Http\Controllers\Upload\SystemAttachmentController::class, 'index'])->name('attachment');
        // 附件添加
        $api->post('attachment', [\App\Http\Controllers\Upload\SystemAttachmentController::class, 'uploads'])->name('attachment');
        // 附件移动
        $api->put('attachment/{attachment}/move', [\App\Http\Controllers\Upload\SystemAttachmentController::class, 'move'])->name('attachment.move');
        //附件重命名
        $api->put('attachment/{attachment}/rename', [\App\Http\Controllers\Upload\SystemAttachmentController::class, 'rename'])->name('attachment.rename');
        // 附件删除
        $api->delete('attachment/{attachment}', [\App\Http\Controllers\Upload\SystemAttachmentController::class, 'destory'])->name('attachment');
        /**
         * 订单相关路由
         */
        // 订单列表
        $api->resource('order', \App\Http\Controllers\Admin\OrderController::class, ['except' => ['update']]);
        // 订单操作日志路由
        $api->get('order/{order}/log', [\App\Http\Controllers\Admin\OrderController::class, 'log'])->name('order.log');
        // 订单管理员备注路由
        $api->get('order/{order}/remark', [\App\Http\Controllers\Admin\OrderController::class, 'remark'])->name('order.remark');
        // 订单管理员备注修改路由
        $api->put('order/{order}/remark', [\App\Http\Controllers\Admin\OrderController::class, 'update_remark'])->name('order.remark');
        // 订单编辑路由
        $api->put('order/{order}/edit', [\App\Http\Controllers\Admin\OrderController::class, 'edit'])->name('order.edit');
        // 订单获取编辑信息路由
        $api->get('order/{order}/edit_log', [\App\Http\Controllers\Admin\OrderController::class, 'edit_log'])->name('order.edit_log');
        // 订单发货路由
        $api->put('order/{order}/send', [\App\Http\Controllers\Admin\OrderController::class, 'send'])->name('order.send');
        // 配送信息路由
        $api->get('order/{order}/delivery_info', [\App\Http\Controllers\Admin\OrderController::class, 'delivery_info'])->name('order.delivery_info');
        // 订单核销路由
        $api->put('order/{order}/checked', [\App\Http\Controllers\Admin\OrderController::class, 'checked'])->name('order.checked');
        // 订单收货路由
        $api->put('order/{order}/receive', [\App\Http\Controllers\Admin\OrderController::class, 'receive'])->name('order.receive');
        // 收银订单路由
        $api->get('cash', [\App\Http\Controllers\Admin\OrderController::class, 'cash'])->name('cash');
        // 退款订单路由
        $api->get('refund', [\App\Http\Controllers\Admin\OrderController::class, 'refund'])->name('refund');
        // 立即退款路由
        $api->put('order/{order}/refund', [\App\Http\Controllers\Admin\OrderController::class, 'do_refund'])->name('order.refund');
        // 拒绝退款路由
        $api->put('order/{order}/refuse', [\App\Http\Controllers\Admin\OrderController::class, 'refuse_refund'])->name('order.refuse');
        // 立即支付顶路由
        $api->put('order/{order}/pay', [\App\Http\Controllers\Admin\OrderController::class, 'pay_now'])->name('order.pay');

        /**
         * 用户相关路由
         */
        $api->resource('users', \App\Http\Controllers\Admin\User\UserController::class, ['except' => ['destroy']]);
        // 管理用户分组的路由
        $api->resource('usergroup_category', \App\Http\Controllers\Admin\Category\UserGroupController::class);
        // 管理用户标签的路由
        $api->resource('user/lable', \App\Http\Controllers\Admin\User\UserLableController::class);
        // 管理用户标签分类的路由
        $api->resource('labelgroup_category', \App\Http\Controllers\Admin\Category\UserLabelClassController::class);
        // 管理用户等级的路由
        $api->resource('user/level', \App\Http\Controllers\Admin\User\UserLevelController::class);
        //设置会员等级状态的路由
        $api->put('user/level/status/{id}', [\App\Http\Controllers\Admin\User\UserLevelController::class, 'status'])
            ->name('level.status');
        //批量设置用户分组的路由
        $api->put('user/set_group', [\App\Http\Controllers\Admin\User\UserController::class, 'usergroup'])->name('set.group');
        //批量设置用户标签的路由
        $api->put('user/set_label', [\App\Http\Controllers\Admin\User\UserController::class, 'userlabel'])->name('set.label');
        //获取用户账户详情的路由
        $api->get('user/details/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'userorder'])->name('user.order');
        //获取用户消费记录的路由
        $api->get('user/recordsconsumption/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'recordsconsumption'])->name('user.recordsconsumption');
        //获取用户积分明细
        $api->get('user/userintegral/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'userintegral'])->name('user.integral');
        //获取用户签到记录的路由
        $api->get('user/usersigns/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'usersigns'])->name('user.signs');
        //获取用户拥有的优惠券的路由
        $api->get('user/usercoupon/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'usercoupon'])->name('user.coupon');
        //获取用户拥有的优惠券的路由
        $api->get('user/userbalance/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'userbalance'])->name('user.balance');
        //获取用户拥有的好友的路由
        $api->get('user/userfriend/{user}', [\App\Http\Controllers\Admin\User\UserDetailscontroller::class, 'userfriend'])->name('user.friend');
        //设置用户的积分和余额的路由
        $api->put('user/setintegral/{user}', [\App\Http\Controllers\Admin\User\SetIntegralController::class, 'setintegral'])->name('set.integral');
        //设置用户的积分和余额的路由
        $api->put('user/giftmember/{user}', [\App\Http\Controllers\Admin\User\SetIntegralController::class, 'giftmember'])->name('gift.member');
        //修改用户分组的路由
        $api->put('user/getgroup/{user}', [\App\Http\Controllers\Admin\User\SetIntegralController::class, 'getrgroup'])->name('get.group');
        //修改用户标签的路由
        $api->put('user/getlable/{user}', [\App\Http\Controllers\Admin\User\SetIntegralController::class, 'getlable'])->name('get.lable');
        //设置用户的推广员
        $api->put('user/getpromoter/{user}', [\App\Http\Controllers\Admin\User\SetIntegralController::class, 'getpromoter'])->name('get.promoter');
        /**
         * 优惠券相关的路由
         */
        //优惠券的资源路由
        $api->resource('coupon', \App\Http\Controllers\Admin\Coupon\CouponController::class);
        //优惠券修改状态的路由
        $api->put('coupon/status/{coupon}', [\App\Http\Controllers\Admin\Coupon\CouponController::class, 'status'])->name('coupon.status');
        //查看优惠券的领取记录的路由
        $api->get('coupon/receive/{coupon}', [\App\Http\Controllers\Admin\Coupon\CouponController::class, 'receive'])->name('coupon.receive');
        //查看用户领取记录的路由
        $api->get('user/collection', [\App\Http\Controllers\Admin\Coupon\CouponController::class, 'usercollection'])->name('user.collection');
        /**
         * 积分相关的路由
         */
        //积分配置的路由
        $api->get('integral_allocation', [\App\Http\Controllers\Admin\Integral\IntegralLogController::class, 'integralAllocation'])->name('integral.allocation');
        //积分配置的路由
        $api->put('updateIntegral', [\App\Http\Controllers\Admin\Integral\IntegralLogController::class, 'updateIntegral'])->name('update.integral');
        //显示积分日志的路由
        $api->get('integral_log', [\App\Http\Controllers\Admin\Integral\IntegralLogController::class, 'index'])->name('integral.log');
        //显示积分数量的路由
        $api->get('integral_sum', [\App\Http\Controllers\Admin\Integral\IntegralLogController::class, 'integral_sum'])->name('integral.sum');
        /**
         * 直播管理的相关路由
         */
        $api->resource('live_room', \App\Http\Controllers\Admin\Integral\LiveRoomsController::class);
        //主持人相关的路由
        $api->resource('live_Anchors', \App\Http\Controllers\Admin\Integral\LiveAnchorsController::class);

        /**
         * 文章资源相关
         */
        $api->resource('article', \App\Http\Controllers\Admin\Article\ArticleController::class);
        //文章管理的状态
        $api->put('article/status/{article}', [\App\Http\Controllers\Admin\Article\ArticleController::class, 'status'])->name('article.status');
        //文章关联商品
        $api->get('relation/{article}', [App\Http\Controllers\Admin\Article\ArticleController::class, 'relation'])->name('article.relation');
        //文章取消关联商品
        $api->get('unrelation/{article}', [App\Http\Controllers\Admin\Article\ArticleController::class, 'unrelation'])->name('article.unrelation');
        //文章分类资源路由
        $api->resource('article_category', \App\Http\Controllers\Admin\Category\ArticleCategoryController::class, ['except' => ['update']]);
        //文章分类修改
        $api->patch('article_category/{article_category}', [\App\Http\Controllers\Admin\Category\ArticleCategoryController::class, 'update'])->name('article_category');
        //文章分类的状态
        $api->put('article_category/status/{article_category}', [\App\Http\Controllers\Admin\Category\ArticleCategoryController::class, 'status'])->name('articlecategory.status');
        //快递公司资源路由
        $api->resource('express', \App\Http\Controllers\Admin\ShippingTemplate\ExpressController::class, ['except' => ['destroy']]);
        //快递公司的状态
        $api->put('express/status/{express}', [\App\Http\Controllers\Admin\ShippingTemplate\ExpressController::class, 'status'])->name('express.status');
        /**
         * 客服管理相关的路由
         */
        //客服话术
        $api->resource('storeservicespeechcrafts', \App\Http\Controllers\Admin\Speechcrafts\StoreServiceSpeechcraftsController::class);
        //客服话术的分类
        $api->resource('feedback_category', \App\Http\Controllers\Admin\Category\FeedbackCategoryController::class);
        //客服反馈
        $api->resource('toreservicefeedback', \App\Http\Controllers\Admin\Speechcrafts\StoreServiceFeedbackController::class, ['except' => ['store', 'update']]);
        //客服反馈的状态
        $api->put('toreservicefeedback/status/{toreservicefeedback}', [\App\Http\Controllers\Admin\Speechcrafts\StoreServiceFeedbackController::class, 'status'])->name('toreservicefeedback.status');
        //留言时间
        $api->get('index', [\App\Http\Controllers\Admin\Speechcrafts\StoreServiceFeedbackController::class, 'index'])->name('toreservicefeedback.index');

        /**
         * 管理权限相关的路由
         */
        //角色管理
        $api->resource('role', \App\Http\Controllers\Admin\Permission\RoleController::class);
        //角色管理的状态
        $api->put('role/status/{role}', [\App\Http\Controllers\Admin\Permission\RoleController::class, 'status'])->name('role.status');
        //管理员列表
        $api->resource('systemadmin', \App\Http\Controllers\Admin\Permission\SystemAdminController::class);
        //管理员的状态
        $api->put('systemadmin/status/{systemadmin}', [\App\Http\Controllers\Admin\Permission\SystemAdminController::class, 'status'])->name('systemadmin.status');
        //权限规则
        $api->resource('permission', \App\Http\Controllers\Admin\Permission\PermissionController::class, ['except' => ['destroy']]);
        //权限规则的状态
        $api->put('permission/status/{permission}', [\App\Http\Controllers\Admin\Permission\PermissionController::class, 'status'])->name('permission.status');
        /**
         * 统计管理相关的路由
         */
        //商品统计
        $api->get('product_log', [\App\Http\Controllers\Admin\Statistics\ProductLogController::class, 'productlog'])->name('product_log.productlog');
        //商品统计的头部
        $api->get('product_log/top', [\App\Http\Controllers\Admin\Statistics\ProductLogController::class, 'top'])->name('product_log.top');
        //环比增长
        $api->get('growth', [\App\Http\Controllers\Admin\Statistics\ProductLogController::class, 'growth'])->name('product_log.growth');
        //折线图
        $api->get('graphical', [\App\Http\Controllers\Admin\Statistics\ProductLogController::class, 'graphical'])->name('product_log.graphical');
        /**
         * 用户统计表
         */
        //用户统计
        $api->get('usertop', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'usertop'])->name('statistics.usertop');
        //用户性别比例
        $api->get('sex', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'sex'])->name('user.sex');
        //用户地域分布人数
        $api->get('addresses', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'addresses'])->name('addresses');
        //环比增长
        $api->get('growth/top', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'growth'])->name('user_log.growth');
        //折线图
        $api->get('chart', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'chart'])->name('user_log.chart');
        //地图数据
        $api->get('map', [\App\Http\Controllers\Admin\Statistics\UserLogController::class, 'map'])->name('user_log.map');
        /**
         * 财务统计
         */
        //交易统计表
        $api->get('finance', [\App\Http\Controllers\Admin\Statistics\TransactionLogController::class, 'finance'])->name('finance.top');
        //环比增长
        $api->get('growth/finance', [\App\Http\Controllers\Admin\Statistics\TransactionLogController::class, 'growth'])->name('finance.growth');
        //折线图
        $api->get('chart/finance', [\App\Http\Controllers\Admin\Statistics\TransactionLogController::class, 'chart'])->name('finance.chart');

        /**
         * 支付相关的路由
         */
        $api->get('orders/pay', [\App\Http\Controllers\Admin\PayController::class, 'pay'])->name('orders.pay');
        //允许查询订单状态
        $api->get('orders/status', [\App\Http\Controllers\Admin\PayController::class, 'payStatus'])->name('orders.status');
        //支付宝支付成功之后的回调
        $api->any('pay/notify/aliyun', [\App\Http\Controllers\Admin\PayController::class, 'notifyAliyun'])->name('pay.notify.aliyun');
        //微信支付成功之后的回调
        $api->any('pay/notify/wechat', [\App\Http\Controllers\Admin\PayController::class, 'notifyWechat'])->name('pay.notify.wechat');
        /**
         * 会员相关api
         */
        //会员卡路由
        $api->resource('membercards', \App\Http\Controllers\Admin\Member\MemberCardController::class);
        //会员卡批次表路由
        $api->resource('membercardbatchs', \App\Http\Controllers\Admin\Member\MemberCardBatchController::class, ['except' => ['update']]);
        //会员卡状态批次路由
        $api->put('membercardbatchs/status', [\App\Http\Controllers\Admin\Member\MemberCardBatchController::class, 'status'])->name('membercardbatchs.status');
        //会员卡批次修改路由
        $api->patch('membercardbatchs/{memberCardBatch}', [\App\Http\Controllers\Admin\Member\MemberCardBatchController::class, 'updatedTitle'])->name('membercardbatchs.updatedTitle');
        //会员权益路由
        $api->resource('memberRights', \App\Http\Controllers\Admin\Member\MemberRightController::class);
        //会员类型路由
        $api->resource('memberShips', \App\Http\Controllers\Admin\Member\MemberShipController::class);
        //配送员相关路由
        $api->resource('deliveryservice', \App\Http\Controllers\Admin\DeliveryServiceController::class);
        //会员购买记录路由
        $api->resource('otherOrders', \App\Http\Controllers\Admin\Member\OtherOrderController::class);


        /**
         * 城市数据相关路由
         */
        $api->resource('citys', \App\Http\Controllers\Admin\CityController::class);
        //清除城市缓存的路由
        $api->get('forgetCity', [\App\Http\Controllers\Admin\CityController::class, 'forgetCity'])->name('forgetCity.cache');

        /**
         * 分销相关路由
         */
        //分销员管理头部
        $api->get('promotersList/top', [\App\Http\Controllers\Admin\PromoterController::class, 'Ispromoter'])->name('promotersList.top');
        //分销员列表显示
        $api->get('promotersList', [\App\Http\Controllers\Admin\PromoterController::class, 'promoterlist'])->name('promotersList');
        //推广员列表
        $api->get('promoters', [\App\Http\Controllers\Admin\PromoterController::class, 'Promoter'])->name('promoters');
        //推广人订单
        $api->get('promoterOrder', [\App\Http\Controllers\Admin\PromoterController::class, 'promoterOrder'])->name('promoterOrder');
        //修改上级推广人
        $api->patch('PromoterUpdate/{user}', [\App\Http\Controllers\Admin\PromoterController::class, 'PromoterUpdate'])->name('PromoterUpdate');
        //上级推广人的信息
        $api->post('getPromoter/{user}', [\App\Http\Controllers\Admin\PromoterController::class, 'getPromoter'])->name('getPromoterd');
        //清除上级推广人
        $api->patch('EliminatePromoter/{user}', [\App\Http\Controllers\Admin\PromoterController::class, 'EliminatePromoter'])->name('EliminatePromoter');
        //取消推广资格路由
        $api->patch('CancelPromoter/{user}', [\App\Http\Controllers\Admin\PromoterController::class, 'CancelPromoter'])->name('CancelPromoter');
        //分销设置列表
        $api->get('PromoterSet', [\App\Http\Controllers\Admin\PromoterSetController::class, 'index'])->name('promSet.index');
        //分销设置
        $api->patch('PromoterSet', [\App\Http\Controllers\Admin\PromoterSetController::class, 'update'])->name('promSet');
        //获取分销设置头部路由
        $api->get('getsystemheader', [\App\Http\Controllers\Admin\PromoterSetController::class, 'get_system_header'])->name('promSet.header');
        //分销等级表路由
        $api->resource('promoterlevel', \App\Http\Controllers\Admin\PromoterLevelController::class);
        //任务等级路由
        $api->resource('tasklevels', \App\Http\Controllers\Admin\TaskLevelController::class);
        //公众号推广二维码
        $api->get('wechatCode', [\App\Http\Controllers\Admin\PromoterController::class, 'wechatCode'])->name('wechatCode');
        //小程序二维码
        $api->get('miniCode', [\App\Http\Controllers\Admin\PromoterController::class, 'miniCode'])->name('miniCode');
        /**
         * 配送员相关路由
         */
        $api->resource('deliveryService', \App\Http\Controllers\Admin\DeliveryServiceController::class, ['except' => ['update']]);
        //返回所有微信用户的信息
        $api->get('wechat', [\App\Http\Controllers\Admin\DeliveryServiceController::class, 'wechat'])->name('wechat.show');
        //配送员状态路由
        $api->patch('deliveryStatus/status', [\App\Http\Controllers\Admin\DeliveryServiceController::class, 'status'])->name('deliveryStatus.status');
        //配送员修改路由
        $api->put('deliveryService/{deliveryService}', [\App\Http\Controllers\Admin\DeliveryServiceController::class, 'deliveryUpdate'])->name('deliveryService.deliveryUpdate');
        /**
         * 提货点相关理由
         */
        $api->resource('sysStores', \App\Http\Controllers\Admin\SystemStoreController::class, ['except' => ['update']]);
        //提货点头部设置
        $api->get('getHeader', [\App\Http\Controllers\Admin\SystemStoreController::class, 'get_header'])->name('getHeader');
        //修改设置
        $api->put('sysStores/{systemStore}', [\App\Http\Controllers\Admin\SystemStoreController::class, 'setUpdate'])->name('sysStores.update');
        //显示设置
        $api->patch('sysStores/status', [\App\Http\Controllers\Admin\SystemStoreController::class, 'status'])->name('sysStores.status');
        /**
         * 核销相关路由
         */
        $api->resource('SystemStoreStaffs', \App\Http\Controllers\Admin\SystemStoreStaffController::class, ['except' => ['update']]);
        //返回微信用户信息
        $api->get('webchatInfo', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'webchat'])->name('webchat');
        //返回所有的门店
        $api->get('stores', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'stores'])->name('stores');
        //修改设置
        $api->put('SystemStoreStaff/{systemStoreStaff}', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'StaffUpdate'])->name('SystemStoreStaff.update');
        //设置状态
        $api->patch('SystemStoreStaff/status', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'status'])->name('SystemStoreStaff.status');
        //返回核销订单头部信息
        $api->get('listHeader', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'listHeader'])->name('listHeader');
        //返回核销列表信息
        $api->get('listInfo', [\App\Http\Controllers\Admin\SystemStoreStaffController::class, 'listInfo'])->name('SystemStoreStaff.listInfo');
        //运费模板路由
        $api->resource('freightTemplates', \App\Http\Controllers\Admin\FreightTemplateController::class, ['except' => ['update', 'destroy', 'show']]);
        //返回单条模板路由
        $api->get('freightTemplates/{shippingTemplates}', [\App\Http\Controllers\Admin\FreightTemplateController::class, 'oneShow'])->name('freightTemplates.oneShow');
        //模板修改
        $api->put('freightTemplates/{shippingTemplates}', [\App\Http\Controllers\Admin\FreightTemplateController::class, 'TemplateUpdate'])->name('freightTemplates.update');
        //模板删除
        $api->delete('freightTemplates/{shippingTemplates}', [\App\Http\Controllers\Admin\FreightTemplateController::class, 'TemplateDestroy'])->name('freightTemplates.destroy');
        /**
         * 商品活动
         */
        //商品秒杀
        $api->resource('seckill', \App\Http\Controllers\Admin\StoreSeckillController::class,);
        //秒杀商品是否上架
        $api->patch('seckill/{storeSeckill}/status', [\App\Http\Controllers\Admin\StoreSeckillController::class, 'status'])->name('seckill.status');
        //秒杀用户表
        $api->get('seckill_user', [\App\Http\Controllers\Admin\StoreSeckillUserController::class, 'index'])->name('seckill_user.index');
        //秒杀用户详情
        $api->get('seckill_user/{id}', [\App\Http\Controllers\Admin\StoreSeckillUserController::class, 'show'])->name('seckill_user.show');
        //商品拼团
        $api->resource('combination', \App\Http\Controllers\Admin\StoreCombinationsController::class,);
        //拼团商品是否上架
        $api->patch('combination/{storeCombination}/status', [\App\Http\Controllers\Admin\StoreCombinationsController::class, 'status'])->name('combination.status');
        //拼团用户表
        $api->get('pink', [\App\Http\Controllers\Admin\StorePinkController::class, 'index'])->name('pink.index');
        //拼团用户总数
        $api->get('pink/total', [\App\Http\Controllers\Admin\StorePinkController::class, 'total'])->name('pink.total');
        //拼团用户表详情
        $api->get('pink/{pink}', [\App\Http\Controllers\Admin\StorePinkController::class, 'show'])->name('pink_user.show');
        //商品砍价
        $api->resource('bargain', \App\Http\Controllers\Admin\StoreBargainController::class,);
        //砍价商品是否上架
        $api->patch('bargain/{storeBargain}/status', [\App\Http\Controllers\Admin\StoreBargainController::class, 'status'])->name('bargain.status');
        //砍价用户表
        $api->get('bargain_user', [\App\Http\Controllers\Admin\StoreBargainUserController::class, 'index'])->name('bargain_user.index');
        //砍价用户表详情
        $api->get('bargain_user/{storeBargainUser}', [\App\Http\Controllers\Admin\StoreBargainUserController::class, 'show'])->name('bargain_user.show');
        //商品积分
        $api->resource('integral', \App\Http\Controllers\Admin\IntegralProductController::class,);
        //积分商品是否上架
        $api->patch('integral/{integral}/status', [\App\Http\Controllers\Admin\IntegralProductController::class, 'status'])->name('integral.status');
        /**
         * 财务管理
         */
        //提现记录列表
        $api->get('user_extract', [\App\Http\Controllers\Admin\Finance\UserExtractController::class, 'index']);
        //提现记录总金额
        $api->get('user_extract/totalPrice', [\App\Http\Controllers\Admin\Finance\UserExtractController::class, 'totalPrice']);
        //编辑提现记录
        $api->put('user_extract/{id}', [\App\Http\Controllers\Admin\Finance\UserExtractController::class, 'update']);
        //状态通过
        $api->get('user_extract/{user_extract}/adopt', [\App\Http\Controllers\Admin\Finance\UserExtractController::class, 'adopt']);
        //状态无效
        $api->get('user_extract/{user_extract}/invalid', [\App\Http\Controllers\Admin\Finance\UserExtractController::class, 'invalid']);
        //发票列表
        $api->get('user_invoice', [\App\Http\Controllers\Admin\Finance\UserInvoiceController::class, 'index']);
        //订单详情
        $api->get('user_invoice/{id}', [\App\Http\Controllers\Admin\Finance\UserInvoiceController::class, 'show']);
        //充值记录列表
        $api->get('user_recharges', [\App\Http\Controllers\Admin\Finance\UserRechargesController::class, 'index']);
        //充值记录总金额
        $api->get('user_recharges/totalPrice', [\App\Http\Controllers\Admin\Finance\UserRechargesController::class, 'totalPrice']);
        //充值删除
        $api->delete('user_recharges/{id}', [\App\Http\Controllers\Admin\Finance\UserRechargesController::class, 'destroy']);
        //资金记录表
        $api->get('user_bills', [\App\Http\Controllers\Admin\Finance\UserBillController::class, 'index']);
        //佣金记录表
        $api->get('brokerage_frozen', [\App\Http\Controllers\Admin\Finance\UserBrokerageController::class, 'index']);
        //查询佣金记录详情的路由
        $api->get('brokerage_frozen/{id}', [\App\Http\Controllers\Admin\Finance\UserBrokerageController::class, 'show']);
        //查询佣金记录详情中用户的路由
        $api->get('brokerage_frozen/user/{id}', [\App\Http\Controllers\Admin\Finance\UserBrokerageController::class, 'show_user']);


        /**
         * 设置管理
         */
        //系统设置获取头部标签
        $api->get('get_system_header', [\App\Http\Controllers\Admin\System\SystemSettingsController::class, 'get_system_header'])->name('system.get_system_header');
        //系统设置列表
        $api->get('system_settings', [\App\Http\Controllers\Admin\System\SystemSettingsController::class, 'index'])->name('system_settings.index');
        //系统设置提交修改
        $api->patch('system_settings', [\App\Http\Controllers\Admin\System\SystemSettingsController::class, 'update'])->name('system_settings.update');
        /**
         * 消息管理-微信模板消息
         */
        $api->resource('system_wechat_messages', \App\Http\Controllers\Admin\WechatTemplateMessagesController::class, ['except' => ['update']]);
        //修改
        $api->patch('system_wechat_messages/{system_wechat_messages}', [\App\Http\Controllers\Admin\WechatTemplateMessagesController::class, 'update'])->name('system_wechat_messages.update');
        //修改状态
        $api->put('system_wechat_messages/{system_wechat_messages}', [\App\Http\Controllers\Admin\WechatTemplateMessagesController::class, 'status'])->name('system_wechat_messages.status');
        //详情
        $api->get('system_wechat_messages/{system_wechat_messages}', [\App\Http\Controllers\Admin\WechatTemplateMessagesController::class, 'show'])->name('system_wechat_messages.show1');
        /**
         * 消息管理-订阅消息
         */
        $api->resource('system_subscription_messages', \App\Http\Controllers\Admin\SubscriptionTemplateMessagesController::class, ['except' => ['update']]);
        //修改
        $api->patch('system_subscription_messages/{system_subscription_messages}', [\App\Http\Controllers\Admin\SubscriptionTemplateMessagesController::class, 'update'])->name('system_subscription_messages.update');
        //修改状态
        $api->put('system_subscription_messages/{system_subscription_messages}', [\App\Http\Controllers\Admin\SubscriptionTemplateMessagesController::class, 'status'])->name('system_subscription_messages.status');
        //详情
        $api->get('system_subscription_messages/{system_subscription_messages}', [\App\Http\Controllers\Admin\SubscriptionTemplateMessagesController::class, 'show'])->name('system_subscription_messages.show');
        /**
         * 安全维护
         */
        //清除缓存
        $api->get('system_cache_clear', [\App\Http\Controllers\Admin\SafetyProtectController::class, 'cacheClear'])->name('system_cache_clear.cacheClear');
        //清除管理员操作日志
        $api->get('system_log_clear', [\App\Http\Controllers\Admin\SafetyProtectController::class, 'systemLogclear'])->name('system_log_clear.systemLogclear');
        //管理员操作日志列表
        $api->get('system_log', [\App\Http\Controllers\Admin\SafetyProtectController::class, 'index'])->name('system_log.index');
        // 测试
        $api->resource('test', \App\Http\Controllers\Admin\TestController::class);
    });
});






